<html>
<head>
<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>

<script href="js/jquery.jqplot.min.js"></script>
<script type="text/javascript" href="js/jqplot.pieRenderer.min.js"></script>
<script type="text/javascript" href="js/jqplot.donutRenderer.min.js"></script>
<!--<link type="text/css" rel="stylesheet" href="js/jquery.jqplot.min.css"/>-->

</head>

<body>
    <input type="submit" value="go" id="go">
    <br>
<div id="chart1" style="height:400px;width:300px; "></div>
<script>
    
    $("#go").click(function()
    {
        $.ajax({
                    type: "POST",
                    url: "demo.do",
                    success: function(data) {
                        console.log(data);
                      //  data=$.parseJSON(data);
                       
                      
                        
                           var plot1 = jQuery.jqplot ('chart1', [data], 
    { 
      seriesDefaults: {
        // Make this a pie chart.
        renderer: jQuery.jqplot.PieRenderer, 
        rendererOptions: {
          // Put data labels on the pie slices.
          // By default, labels show the percentage of the slice.
          showDataLabels: true
          
        }
      }, 
      legend: { show:true, location: 'e' }
    }
  );
            
    }
                });
    });
    
    
//$(document).ready(function(){
//  var data = [
//      ['Heavy Industry',12],
//    ['Retail',9], 
//    ['Light Industry',14], 
//    ['Out of home', 16],
//    ['Commuting', 7], 
//    ['Orientation',9]
//  ];
//  var plot1 = jQuery.jqplot ('chart1', [data], 
//    { 
//      seriesDefaults: {
//        // Make this a pie chart.
//        renderer: jQuery.jqplot.PieRenderer, 
//        rendererOptions: {
//          // Put data labels on the pie slices.
//          // By default, labels show the percentage of the slice.
//          showDataLabels: true
//        }
//      }, 
//      legend: { show:true, location: 'e' }
//    }
//  );
//});
</script>
</body>
</html>